﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace WebHost.captcha
{
    public partial class GetCaptcha : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            String captchaResult;
            if (String.Equals(Request.RequestType, "POST") && Request["captcha"] != null && Session["correctcode"] != null && Session["correctcode"].ToString() == Request["captcha"].ToString())
            {
                captchaResult = "Pass";
                Response.Write(captchaResult);
                Response.End();
                Session.Contents.Remove("correctcode");
            }
            else if (String.Equals(Request.RequestType, "POST") && Request["captcha"] != null)
            {
                string a = Request["captcha"].ToString();
                //captchaResult = "Fail";   //为了调试暂时更改
                captchaResult = "Pass";
                Response.Write(captchaResult);
                Response.End();
            }
        }
    }
}